#pragma once

#ifdef GK_DEVICE_DIRECTX10

namespace gk
{
	struct ConstantBufferInternal
	{
		Buffer				m_buffer;
		union
		{
			void*							m_pRaw;
			cr::Vec4f*						m_pVecs;
			ID3D10ShaderResourceView**		m_ppTextures;
		};
	};
}

#include "GkTexture.h"
#include "GkConstantBuffer.h"

namespace gk
{
	inline void ConstantBuffer::SetConstant(cr::uint32_t slot, TextureHandle hTexture)
	{
// 		CR_ASSERT(m_target == ConstantBufferTarget::PixelSamplers || m_target == ConstantBufferTarget::VertexSamplers);
// 		m_internal.m_ppTextures[slot] = hTexture->m_internal.m_pShaderResourceView;
	}

	inline void	ConstantBuffer::SetConstant(cr::uint32_t slot, float v)
	{
		/*m_internal.m_pVecs[slot] = cr::Vec4f(v,v,v,v);*/
	}

	inline void	ConstantBuffer::SetConstant(cr::uint32_t slot, cr::Vec4fRef v)
	{
		/*m_internal.m_pVecs[slot] = v;*/
	}

	inline void ConstantBuffer::SetConstant(cr::uint32_t slot, cr::Matrix4fRef v)
	{
// 		SetConstant(slot+0, v.m_Xaxis);
// 		SetConstant(slot+1, v.m_Yaxis);
// 		SetConstant(slot+2, v.m_Zaxis);
// 		SetConstant(slot+3, v.m_translation);
	}
}

#endif // GK_DEVICE_DIRECTX10
